package Kwiaciarnia;

public class Customer {
	
	private double cash=0 ;
	private ShoppingCart shoppingCart= new ShoppingCart(this);
	private String name;
	
	public Customer(String name, double cash) {
		this.name = name;
		this.cash= cash;		
	}
	
	public void get(Flowers flower) {		
		shoppingCart.putFlowers(flower);		
	}

	public ShoppingCart getShoppingCart() {	
		return shoppingCart;
	}

	public void pay() {
		cash =cash-shoppingCart.pay(cash);
	}
	
	public double getCash(){
		return cash;
	}
	
	public String getCustomerName(){
		return name;
	}

	public void pack(Box pudelkoJanka) {
		for (Flowers f : shoppingCart.getOrderList()) {
			pudelkoJanka.putFlowers(f);
		}
		shoppingCart.getOrderList().clear();	
	}
	
	
		
}
